package com.example.layoutlest;

import android.content.Intent;
import android.app.Activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;


public class ThirdActivity extends AppCompatActivity {

    EditText ed_id;
    EditText ed_pwd;
    Button btnlogin;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_third);
        ed_id=(EditText) findViewById(R.id.xuehao);
        ed_pwd = (EditText) findViewById(R.id.password);
        btnlogin = (Button) findViewById(R.id.btnSend);
        btnlogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                getUser();
            }
        });
    }

    public void getUser() {

        if (ed_id.getText().toString().equals("201958504227")&&ed_pwd.getText().toString().equals("123456") )
        {
            Toast.makeText(this, "登录成功", 5000).show();

            Intent intent = new Intent(this,FourthActivity.class);
            startActivity(intent);

        } else {
            Toast.makeText(this, "用户名或者密码错误", 5000).show();
        }
    }

}


